package com.wzy.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wzy.domain.Student;
import com.wzy.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wzy
 * @Date: 2022/3/23 14:29
 * @Description:
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private IStudentService studentService;

    @RequestMapping("/getAll")
    public List<Student> list() {
        return studentService.list();
    }
    @RequestMapping("/getPage")
    public IPage<Student> listByPage() {
        Page<Student> page = new Page<>();
        page.setCurrent(1);
        page.setSize(3);
        return studentService.getStudentPage(page);

    }

}
